package com.sju.edu;

import net.webtech.*;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.http.*;
import com.google.appengine.api.users.User;
import com.google.appengine.api.users.UserService;
import com.google.appengine.api.users.UserServiceFactory;



@SuppressWarnings("serial")
public class GardenGAEServlet extends HttpServlet {
	
	public void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws IOException {

        resp.setContentType("text/plain");
		PrintWriter out = resp.getWriter();
		
        String str = req.getParameter("query");
        if(str != null){
        	try{
        		int query = Integer.parseInt(str);
        		GardenDOMService g = new GardenDOMService();
        		switch(query){
        			case 1:
        				out.println(g.queryA());
        				break;
        			case 2:
        				out.println(g.queryB());
        				break;
        			case 3:
        				out.println(g.queryC());
        				break;
        			case 4:
        				out.println(g.queryD());
        				break;
        			case 5:
        				out.println(g.queryE());
        				break;
        			case 6:
        				out.println(g.queryF());
        				break;
        			case 7:
        				out.println(g.queryG());
        				break;
        		}
        		out.close();
            }catch(NumberFormatException e){
        		out.println("Error - not a number");
        	}
        }
		
	}
}
